package com.objectproject.main.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.objectproject.main.dao.MembershipDAOImpl;
import com.objectproject.main.model.MyGroup;
import com.objectproject.main.model.MyUser;
import com.objectproject.main.service.iface.MembershipService;
import com.objectproject.main.service.subsystem.MyLocaleResolver;

@Service
public class MembershipServiceImpl implements MembershipService {

	@Autowired
	MembershipDAOImpl membershipDAOImpl;
	
	@Autowired
	MyLocaleResolver myLocaleResolver;

	@Override
	public void join(MyUser myUser, MyGroup myGroup) {
		
		//조건 체크
		
		membershipDAOImpl.insertMembership(myUser.getUserId(), myGroup.getGroupId());
	}

	@Override
	public void withdraw(MyUser myUser, MyGroup myGroup) {
		membershipDAOImpl.deleteMembership(myUser.getUserId(), myGroup.getGroupId());
	}
	
	

}
